$web = Get-SPWeb $args[0]
write-host "Current value: " $web.GetProperty("__PublishingFeatureActivated");
$web.AddProperty("__PublishingFeatureActivated", "True") -ea 0;
$web.SetProperty("__PublishingFeatureActivated", "True");
$web.AllProperties["__PagesListId"] = $web.Lists["Pages"].ID.ToString()
$web.update();
write-host "Done."
